package com.eastcom.providor.dao.impl;

import java.util.List;

import com.eastcom.bm.atom.Atom_ActionEmailNotice;
import com.eastcom.providor.dao.BaseDao;
import com.eastcom.providor.dao.IEmailNoticeDao;

public class EmailNoticeDao extends BaseDao implements IEmailNoticeDao {

	public Atom_ActionEmailNotice findEmailNoticeByUUID(String uuid)throws Exception {
		try{
			List<Atom_ActionEmailNotice> actionEmailNotices=this.getObjects("from Atom_ActionEmailNotice where uuid='"+uuid+"'");
			return actionEmailNotices==null||actionEmailNotices.isEmpty()?null:actionEmailNotices.get(0);
		}
		catch(Exception e){
			throw e;
		}
	}

	public List<Atom_ActionEmailNotice> getAllEmailNotice() throws Exception {
		try{
			return this.getObjects(Atom_ActionEmailNotice.class);
		}
		catch(Exception e){
			throw e;
		}
	}

	public void deleteByUUID(String uuid) throws Exception {
		try{
		    this.deleteObject(Atom_ActionEmailNotice.class, uuid);
		}
		catch(Exception e){
			throw e;
		}
	}

}
